-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
container provider: add External Logging Support SupportFeature #13319
container provider: add External Logging Support SupportFeature #13319
Conversation
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@@ -23,6 +24,12 @@ class ContainerManager < BaseManager | |||
|
|||
virtual_column :port_show, :type => :string | |||
|
|||
supports :common_logging do | |||
unless respond_to?(:common_logging_route_name) | |||
unsupported_reason_add(:common_logging, _('This provider type doesn\'t support common_logging')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change contraction doesn't
to does not
app/models/container_node.rb
Outdated
|
||
supports :common_logging do | ||
unless ext_management_system.respond_to?(:common_logging_route_name) | ||
unsupported_reason_add(:common_logging, _('This provider type doesn\'t support common_logging')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change contraction doesn't
to does not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
7840754
to
1edab2f
Compare
end | ||
|
||
def common_logging_path | ||
'/#/dashboard/Operations-Logs-Overivew' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enoodle is this dashboard always available? Because IIUC it's not shipped with Kibana.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @portante
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simon3z I agree, I changed this to '/' (default entry screen of kibana). We should find a way to inject those dashboards and then have another PR to change this accordingly.
1edab2f
to
f639edf
Compare
ping @dkorn, @moolitayer , @zeari Please review |
@@ -20,6 +20,18 @@ def self.event_monitor_class | |||
ManageIQ::Providers::Openshift::ContainerManager::EventCatcher | |||
end | |||
|
|||
def common_logging_route_name | |||
Settings.container_logging.common_logging_route | |||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think about going with Settings.container_logging.try(:common_logging_route)
and handling a nil
since I dont know if existing miq instances will re-seed the config/settings.yml
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I will have to try for container_logging
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handling the nil
result will be in the UI PR (huh...)
f639edf
to
201d9fd
Compare
app/models/container_node.rb
Outdated
end | ||
|
||
def common_logging_path | ||
hostname = name.split('.')[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want a query that looks like: "hostname:" OR "hostname:<value.split('.')[0]>"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enoodle @portante do we know officially what this field hostname
should contain?
Isn't there another field to filter by where the FQDN is used?
I know chances are low... but aren't you worried of collisions of hostnames if you're not using FQDN? (And also with FQDN there could be collisions, but there it's more a deployment issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, logs almost never have perfect metadata, and so while we strive to have an FQDN in the hostname field, as is the case already in OpenShift 3.4, some parts of the system send an FQDN in, some just $(hostname -s). So, yes, collisions are there, but usually there is other metadata in the logs that help to distinguish the log entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I handled the case that name
is nil and changed to a query of both the hostname and the fqdn.
@miq-bot assign enoodle |
201d9fd
to
e99e3bb
Compare
app/models/container_node.rb
Outdated
end | ||
|
||
def common_logging_path | ||
hostname = (name || "").split('.').first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enoodle for me this is still:
> name = nil
> (name || "").split('.').first
=> nil
am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simon3z I should have explained myself better:
I changed the query below to filter for an OR between name
and hostname
. If name
will be nil then hostname
will be nil as well and their #{name}
will return an empty string, which will cause this query to match all values and the user will be presented with the regular discovery page presenting all of the logs.
do you think I should add this as a comment?
Edit: No, I am sorry, The query won't catch all, it will be wrong, and an error message will be shown in Kibana about not being able to parse the query, but all the logs will be shown.
@portante can you ack this PR if it looks good to you? |
e99e3bb
to
6feafda
Compare
6feafda
to
926e94d
Compare
LGTM 👍 But @Fryguy had a question on the Even though in theory it is correct that the setting should be per-provider, on the other hand OpenShift has no documentation on how to change the name of the route which at the moment is hard-coded in all the deployment scripts Not sure if it's worth a per-provider setting ATM. |
ping, tests were failing due to a problem in brakeman (?) , I rebased. |
ping @Fryguy |
@enoodle can you check if this works with an "OpenShift Container Platform" provider (vs. just "OpenShift Origin")? To me it seems that with "OpenShift Container Platform" is not working. |
@simon3z I will check, can you make sure you have both this PR and the UI counterpart? |
@enoodle I am looking at this on the setup that you helped @moolitayer with few week ago. For "OpenShift Origin" providers I can see the link for the "OpenShift Container Platform" one I can't. Please double check all the code. |
595fb80
to
4c6b56a
Compare
@simon3z fixed. I moved the kibana support definitions to |
4c6b56a
to
a5a01e1
Compare
LGTM 👍 ping @Fryguy @chessbyte can you (review/)merge? |
ping @Fryguy @chessbyte |
LGTM within just the context of this PR, so I think it's OK to merge. I have some high level questions regarding the overall design, though perhaps @simon3z we can discuss later? In particular,
|
@blomquisg Thoughts on the supports feature usage here? |
@Fryguy This is using the resources from the Openshift container manager to read the routes and direct the user to that link. The Datawarehouse manager will also be reading from Elasticsearch but here we want to give the user access to Kibana UI that is already deployed on the cluster. We need the feature because some container providers will not support route names yet (like kubernetes). |
splitting common logging launch to a feature mixin
a5a01e1
to
97ac328
Compare
@Fryguy @blomquisg I changed the name to External Logging Support, PTAL |
Any update on this @Fryguy @chessbyte @chessbyte ? Is there anything holding this back? |
Checked commit enoodle@97ac328 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@Fryguy @blomquisg @chessbyte can anyone explain why this is neglected for so long? It's 13 days that we're asking for a feedback. |
@simon3z no ... sorry, the ping to me got lost in my emails and it wasn't assigned to me so I didn't see it ... I need a better way of sifting through the github notifications :/ |
Adding common logging launch as a feature mixin.
Provider link will land on pre configured dashboard that is controlled in
common_logging_path
resubmmiting #10648 without the UI part.
corresponding UI PR: ManageIQ/manageiq-ui-classic#36